package com.toolkit.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OSSConfig {


    @Value("${oss.endpoint}")
    private String endpoint;
    @Value("${oss.bucketName}")
    private String bucketName;
    @Value("${oss.ak}")
    private String ak;
    @Value("${oss.sk}")
    private String sk;

    @Bean
    public OSS ossClient() {
        OSS ossClient = new OSSClientBuilder().build(endpoint, ak, sk);
        return ossClient;
    }
}
